package com.ruoyi.web.util;

import com.ruoyi.web.controller.platform.HealthPatInfoController;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.InputStreamReader;

public class ReadTpltoStr
{
    public static String readTol(String filename)
    {
        InputStreamReader inputStreamReader = null;
        BufferedReader bufferedReader = null;
        FileInputStream fileInputStream = null;
        InputStream inputStream = null;
        String str = "";
        try {
           inputStream = HealthPatInfoController.class.getResourceAsStream("/templates/" + filename);
            inputStreamReader = new InputStreamReader(inputStream, "UTF-8");
            bufferedReader = new BufferedReader(inputStreamReader);
            String s;

            while ((s = bufferedReader.readLine()) != null) {
                str += s;
            }
            System.out.println(str);
        }catch (Exception e)
        {
            e.printStackTrace();
        }finally {

        }
        return  str;
    }

    public static void main(String args [])
    {
        readTol("tpl_SaveGjgBsqk.xml");
    }

}
